import Main from './views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: 'Login - 登录'
    },
    component: resolve => { require(['./views/login.vue'], resolve); }
};

export const page404 = {
    path: '/*',
    name: 'error_404',
    meta: {
        title: '404-页面不存在'
    },
    component: resolve => { require(['./views/error_page/404.vue'], resolve); }
};

export const page401 = {
    path: '/401',
    meta: {
        title: '401-权限不足'
    },
    name: 'error_401',
    component: resolve => { require(['./views/error_page/401.vue'], resolve); }
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error_500',
    component: resolve => { require(['./views/error_page/500.vue'], resolve); }
};

export const preview = {
    path: '/preview',
    name: 'preview',
    component: resolve => { require(['./views/form/article-publish/preview.vue'], resolve); }
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: resolve => { require(['./views/main_components/locking-page.vue'], resolve); }
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: Main,
    children: [
        { path: 'home', title: '首页', name: 'home_index', component: resolve => { require(['./views/home/home.vue'], resolve); } },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: resolve => { require(['./views/own-space/own-space.vue'], resolve); } },
        { path: 'ownspace/:username', title: '带参个人中心', name: 'ownspace_with_name', component: resolve => { require(['./views/own-space/own-space.vue'], resolve); } },  // 用于展示带参路由
        { path: 'order/:order_id', title: '订单详情', name: 'order_info', component: resolve => { require(['./views/argument-page/order-info.vue'], resolve); } },  // 用于展示带参路由
        { path: 'message', title: '消息中心', name: 'message_index', component: resolve => { require(['./views/message/message.vue'], resolve); } },
        {path: 'upSlideImg', title: '轮播图上传', name: 'upSlideImg',component: resolve => { require(['./views/mypage/appmanage/slide/UpSlideImg.vue'], resolve); }}
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
    {
        path: '/member',
        icon: 'social-octocat',
        title: '会员管理',
        name: 'member',
        component: Main,
        children: [
            { path: 'member_list', title: '会员列表', name: 'member_list',  icon: 'ios-people',component: resolve => { require(['./views/mypage/member/MemberList.vue'], resolve); } },
            { path: 'member_level_list', title: '等级设置' +
            '', name: 'member_level_list ', icon: 'ribbon-b', component: resolve => { require(['./views/mypage/member/MemberLevelList.vue'], resolve); } },
            { path: 'member_wallet', title: '会员钱包', name: 'member_wallet', icon: 'social-bitcoin', component: resolve => { require(['./views/mypage/member/Memberwallet.vue'], resolve); } }
        ]
    },
    {
        path: '/anchor',
        icon: 'social-reddit',
        title: '主播管理',
        name: 'anchor',
        component: Main,
        children: [
            { path: 'anchor_list', title: '主播列表', name: 'anchor_list',  icon: 'person-stalker',component: resolve => { require(['./views/mypage/anchor/AnchorList.vue'], resolve); } },
            { path: 'anchor_level_list', title: '等级设置', name: 'anchor_level_list ', icon: 'ribbon-a', component: resolve => { require(['./views/mypage/anchor/AnchorLevelList.vue'], resolve); } }
        ]
    },
    {
        path: '/gifts',
        icon: 'quote',
        title: '礼物管理',
        name: 'gifts',
        component: Main,
        children: [
            { path: 'gift_list', title: '礼物列表', name: 'gift_list', icon: 'android-color-palette',component: resolve => { require(['./views/mypage/gifts/GiftList.vue'], resolve); } },
            { path: 'gift_history_list', title: '赠送记录', name: 'gift_history_list', icon: 'arrow-graph-up-right',component: resolve => { require(['./views/mypage/gifts/GiftHistoryList.vue'], resolve); } }
        ]
    },
    {
        path: '/liveroom',
        icon: 'ios-recording',
        title: '直播间',
        name: 'liveroom',
        component: Main,
        children: [
            { path: 'live_list', title: '正在直播列表', name: 'live_list', icon: 'film-marker',component: resolve => { require(['./views/mypage/liveroom/LiveList.vue'], resolve); } },
            { path: 'live_video', title: '直播间监控', name: 'live_video', icon: 'videocamera',component: resolve => { require(['./views/mypage/liveroom/LiveVideo.vue'], resolve); } },
        ]
    },
    {
        path: '/appmanage',
        icon: 'social-android',
        name: 'appmanage',
        title: 'APP管理',
        component: Main,
        children: [
            {path: 'app_Slide',icon: 'images',name: 'app_Slide',title: '轮播图管理',component: resolve => { require(['./views/mypage/appmanage/slide/APPSlide.vue'], resolve); }},
            {path: 'advertisement',icon: 'easel',name: 'advertisement',title: '广告位管理',component: resolve => { require(['./views/mypage/appmanage/advertisement/Advertisement.vue'], resolve); }},
            {path: 'version_list',icon: 'android-options',name: 'version_list',title: '版本管理',component: resolve => { require(['./views/mypage/appmanage/version/VersionList.vue'], resolve); }},
        ]
    },
    {
        path: '/pay',
        icon: 'podium',
        name: 'pay',
        title: '充值管理',
        component: Main,
        children: [
            {path: 'pay_manage',icon: 'ios-pie',name: 'pay_manage',title: '兑换比例',component: resolve => { require(['./views/mypage/pay/PayManage.vue'], resolve); }},
            {path: 'pay_order',icon: 'document-text',name: 'pay_order',title: '充值记录',component: resolve => { require(['./views/mypage/pay/PayOrder.vue'], resolve); }},
        ]
    },
    {
        path: '/accusation',
        icon: 'alert',
        title: '举报管理',
        name: 'accusation',
        component: Main,
        children: [
            { path: 'accusation', title: '举报管理', name: 'accusation',  icon: 'compose',component: resolve => { require(['./views/mypage/accusation/Accusation.vue'], resolve); } },
        ]
    },
    {
        path: '/systemsetting',
        icon: 'gear-b',
        title: '系统设置',
        name: 'systemsetting',
        component: Main,
        children: [
            { path: 'system_setting', title: '系统设置', name: 'system_setting',  icon: 'compose',component: resolve => { require(['./views/mypage/systemsetting/SystemSetting.vue'], resolve); } },
        ]
    },
    // {
    //     path: '/access-test',
    //     icon: 'lock-combination',
    //     title: '权限测试页',
    //     name: 'accesstest',
    //     access: 0,
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '权限测试页', name: 'accesstest_index' }
    //     ]
    // },

    // {
    //     path: '/component',
    //     icon: 'social-buffer',
    //     name: 'component',
    //     title: '组件',
    //     component: Main,
    //     children: [
    //         {
    //             path: 'text-editor',
    //             icon: 'compose',
    //             name: 'text-editor',
    //             title: '富文本编辑器',
    //             component: resolve => { require(['./views/my_components/text-editor/text-editor.vue'], resolve); }
    //         },
    //         {
    //             path: 'md-editor',
    //             icon: 'pound',
    //             name: 'md-editor',
    //             title: 'Markdown编辑器',
    //             component: resolve => { require(['./views/my_components/markdown-editor/markdown-editor.vue'], resolve); }
    //         },
    //         {
    //             path: 'image-editor',
    //             icon: 'crop',
    //             name: 'image-editor',
    //             title: '图片预览编辑',
    //             component: resolve => { require(['./views/my_components/image-editor/image-editor.vue'], resolve); }
    //         },
    //         {
    //             path: 'draggable-list',
    //             icon: 'arrow-move',
    //             name: 'draggable-list',
    //             title: '可拖拽列表',
    //             component: resolve => { require(['./views/my_components/draggable-list/draggable-list.vue'], resolve); }
    //         },
    //         {
    //             path: 'file-upload',
    //             icon: 'android-upload',
    //             name: 'file-upload',
    //             title: '文件上传',
    //             component: resolve => { require(['./views/my_components/file-upload/file-upload.vue'], resolve); }
    //         },
    //         {
    //             path: 'count-to',
    //             icon: 'arrow-graph-up-right',
    //             name: 'count-to',
    //             title: '数字渐变',
    //             component: resolve => { require(['./views/my_components/count-to/count-to.vue'], resolve); }
    //         }
    //     ]
    // },
    // {
    //     path: '/form',
    //     icon: 'android-checkbox',
    //     name: 'form',
    //     title: '表单编辑',
    //     component: Main,
    //     children: [
    //         { path: 'artical-publish', title: '文章发布', name: 'artical-publish', icon: 'compose', component: resolve => { require(['./views/form/article-publish/article-publish.vue'], resolve); } },
    //         { path: 'workflow', title: '工作流', name: 'workflow', icon: 'arrow-swap', component: resolve => { require(['./views/form/work-flow/work-flow.vue'], resolve); } }
    //
    //     ]
    // },
    // {
    //     path: '/tables',
    //     icon: 'ios-grid-view',
    //     name: 'tables',
    //     title: '表格',
    //     component: Main,
    //     children: [
    //         { path: 'dragableTable', title: '可拖拽排序', name: 'dragable-table', icon: 'arrow-move', component: resolve => { require(['./views/tables/dragable-table.vue'], resolve); } },
    //         { path: 'editableTable', title: '可编辑表格', name: 'editable-table', icon: 'edit', component: resolve => { require(['./views/tables/editable-table.vue'], resolve); } },
    //         { path: 'exportableTable', title: '表格导出数据', name: 'exportable-table', icon: 'code-download', component: resolve => { require(['./views/tables/exportable-table.vue'], resolve); } },
    //         { path: 'table2image', title: '表格转图片', name: 'table-to-image', icon: 'images', component: resolve => { require(['./views/tables/table-to-image.vue'], resolve); } }
    //     ]
    // },
    // {
    //     path: '/argument-page',
    //     icon: 'ios-infinite',
    //     name: 'argupage',
    //     title: '带参页面',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '带参页面', name: 'argupage_index', component: resolve => { require(['./views/argument-page/argument-page.vue'], resolve); } }
    //     ]
    // },
    // {
    //     path: '/argument-page',
    //     icon: 'ios-infinite',
    //     name: 'test',
    //     title: '测试',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '测试', name: 'test_Test', component: resolve => { require(['./views/test/Test.vue'], resolve); } }
    //     ]
    // },
    // {
    //     path: '/error-page',
    //     icon: 'android-sad',
    //     title: '错误页面',
    //     name: 'errorpage',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '错误页面', name: 'errorpage_index', component: resolve => { require(['./views/error_page/error-page.vue'], resolve); } }
    //     ]
    // }
];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    preview,
    locking,
    ...appRouter,
    page500,
    page401,
    page404
];


